﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Test_EnemyManager : MonoBehaviour {

    public Timer timer;

    public GameObject EnemyArrowPrefab;
    public List<MapGraphNode> EnemyArrowPivots;
    public float InitArrowTime;
    public MapGraphNode center;



	// Use this for initialization
	void Start () {
        timer = new Timer(InitArrowTime);

    }
	
	// Update is called once per frame
	void Update () {
        if(timer.Tick(Time.deltaTime))
        {
            int randomID = Random.Range(0, EnemyArrowPivots.Count);
            var arrow= Instantiate(EnemyArrowPrefab, EnemyArrowPivots[randomID].transform.position, EnemyArrowPivots[randomID].transform.rotation);
            arrow.GetComponent<EnemyArrow>().target = center.transform;


        }
		
	}
}
